<?php

namespace app\api\controller;

use app\admin\model\Slide;
use app\common\controller\Api;

/**
 * 首页接口
 */
class Index extends Api
{
    protected $noNeedLogin = ['*'];
    protected $noNeedRight = ['*'];



    public function slide(){
        $slide_model = new \app\admin\model\Slide();
        $list        = $slide_model
            ->order(['weigh'=>'desc'])
            ->paginate();
        $data = [];
        if($list){
            $list->toArray();
            foreach ($list as $val){
                $data[] = [
                    'image' => cdnurl($val['images'])
                ];
            }
        }
        $this->success('获取成功',$data);
    }

    /**
     * 首页
     *
     */
    public function index()
    {
        $this->success('请求成功');
    }
}
